#include<iostream>
#include<iomanip>
#include<windows.h>
#include<cstdlib>
#include<ctime>
using namespace std;
int main(int argc,char *argv[]){
	HWND hWnd= GetForegroundWindow(); 
	ShowWindow(hWnd, SW_HIDE);
	MessageBox(NULL,"This is a scan and kill virus tool by QQ:2185220079.","Caixukun(R) Antivirus",MB_OK);
	MessageBox(NULL,"Caixukun(R) antivirus will scan and kill virus.","Get ready...",MB_OK);
	srand(time(NULL));
	int memz=(int)rand()%2,wcry=(int)rand()*memz*2739%2;
	ShowWindow(hWnd, SW_SHOW);
	srand(time(NULL));
	int memzpercent=200+rand()%500;
	int wcrypercent=200+rand()%750*memzpercent%500;
	for(int i=0;i<1000;i++) {
		cout<<fixed<<setprecision(1)<<i/10.0<<"% complete..."<<endl;
		cout<<"          --By Caixukun(R) Secure Studio"<<endl;
		cout<<endl<<endl<<endl;
		cout<<"Copyright(c)Caixukun(R) Secure Studio-Main Developer:@Cmd_MEMZ in www.bilibili.com";
		if(i==memzpercent&&memz==1){
			ShowWindow(hWnd, SW_HIDE);
			MessageBox(NULL,"Caixukun(R) antivirus have found \"MEMZ\". Caixukun(R) antivirus will kill it","Found",MB_OK);
			Sleep(500);
			MessageBox(NULL,"Caixukun(R) antivirus have killed \"MEMZ\".","Killed",MB_OK);
			ShowWindow(hWnd, SW_SHOW);
		}
		if(i==wcrypercent&&wcry==1){
			ShowWindow(hWnd, SW_HIDE);
			MessageBox(NULL,"Caixukun(R) antivirus have found \"WannaCry\". Caixukun(R) antivirus will kill it","Found",MB_OK);
			Sleep(500);
			MessageBox(NULL,"Caixukun(R) antivirus have killed \"Wannacry\".","Killed",MB_OK);
			ShowWindow(hWnd, SW_SHOW);
		}
		Sleep(20);
		system("cls");
	}
	
	ShowWindow(hWnd, SW_HIDE);
	if(wcry+memz==0)
		MessageBox(NULL,"Caixukun(R) antivirus has not found any virus :) Please protect your computer :)",":)",MB_OK);
	if(wcry+memz==1)
		MessageBox(NULL,"Caixukun(R) antivirus has found 1 virus. Please protect your computer.","Found 1",MB_OK);
	if(wcry+memz==2)
		MessageBox(NULL,"Caixukun(R) antivirus has found 2 virus!!! You must protect your computer!!!","Your computer is in danger!!!",MB_OK);
	exit(0);
}  
